Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@logux/server
Advanced tools
Changelog
0.10.8
Readme
Logux is a new way to connect client and server. Instead of sending HTTP requests (e.g., AJAX and GraphQL) it synchronizes log of operations between client, server, and other clients.
This repository contains Logux server with:
import { fileURLToPath } from 'url'
const server = new Server(
Server.loadOptions(process, {
controlSecret: 'secret',
subprotocol: '1.0.0',
supports: '0.6.2',
backend: 'http://localhost:3000/logux',
fileUrl: import.meta.url
})
)
server.listen()
import { fileURLToPath } from 'url'
import { isFirstOlder } from '@logux/core'
import { dirname } from 'path'
import { Server } from '@logux/server'
const server = new Server(
Server.loadOptions(process, {
subprotocol: '1.0.0',
supports: '1.x',
fileUrl: import.meta.url
})
)
server.auth(async ({ userId, token }) => {
const user = await findUserByToken(token)
return !!user && userId === user.id
})
server.channel('user/:id', {
access (ctx, action, meta) {
return ctx.params.id === ctx.userId
},
async load (ctx, action, meta) {
const user = await db.loadUser(ctx.params.id)
return { type: 'USER_NAME', name: user.name }
}
})
server.type('CHANGE_NAME', {
access (ctx, action, meta) {
return action.user === ctx.userId
},
resend (ctx, action, meta) {
return { channel: `user/${ ctx.userId }` }
},
async process (ctx, action, meta) {
if (isFirstOlder(lastNameChange(action.user), meta)) {
await db.changeUserName({ id: action.user, name: action.name })
}
}
})
server.listen()
FAQs
Build own Logux server or make proxy between WebSocket and HTTP backend on any language
The npm package @logux/server receives a total of 90 weekly downloads. As such, @logux/server popularity was classified as not popular.
We found that @logux/server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.